package com.cg.controller;

import com.cg.dto.ForecastPageDto;
import com.cg.dto.Result;
import com.cg.dto.ResultUtils;
import com.cg.service.ForecastService;
import com.cg.vo.ForecastVo;
import com.github.pagehelper.PageInfo;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

/**
 * (Forecast)表控制层
 *
 * @author chengong
 * @since 2023-12-25 18:40:00
 */
@RestController
@RequestMapping("/forecast")
public class ForecastController {
    /**
     * 服务对象
     */
    @Resource
    private ForecastService forecastService;

    /**
     * 查询销售预测信息列表
     */
    @PostMapping("/list")
    public Result<Map<String,Object>> list(@RequestBody ForecastPageDto forecastPageDto){
        PageInfo<ForecastVo> pageInfo = forecastService.list(forecastPageDto);
        Map<String,Object> map = new HashMap<>();
        map.put("pageInfo",pageInfo);
        return ResultUtils.returnDataSuccess(map);
    }

}

